<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>CORS Test</title>
</head>
<body>
  <script src="jquery-3.2.1.js"></script>
  <script>
    var body = JSON.stringify({
      id: 1, instruction: '指定成员 1 2'
    })

    function sendTo3000 () {
      var targetUrl = 'http://localhost:3001/index.html?foo=bar'
      var url = 'http://localhost:3000/' + encodeURIComponent(targetUrl)
      $.post(url, body, function () {
        console.log(arguments)
      })
    }

    function sendToQingyunke () {
      var targetUrl = 'http://api.qingyunke.com/api.php?key=free&appid=0&msg=123'
      var url = 'http://localhost:3000/' + encodeURIComponent(targetUrl)
      $.get(url, function () {
        console.log(arguments)
      })
    }
    
  </script>
</body>
</html>